<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.

// 设置bootstrap路径别名
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'name'=>'My Web Application', // 应用名称

	'theme'=>'bootstrap', // 主题

	'defaultController' => 'site', // 默认控制器

	'language' => 'zh_cn', // 目标语言

	// preloading 'log' component
	'preload' => array('log'),

	// autoloading model and component classes
	'import' => array(
		'application.models.*',
		'application.components.*',
		'ext.image.helpers.*'
	),

	'modules' => array(

		// uncomment the following to enable the Gii tool
		'gii' => array(
			'class' => 'system.gii.GiiModule',
			'password' => 'angel',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters' => array('127.0.0.1','::1'),
			'generatorPaths' => array(
				'bootstrap.gii',
			),
		),

	),

	// application components
	'components'=>array(

		'user' => array(
			// enable cookie-based authentication
			'allowAutoLogin' => true,
		),

		// uncomment the following to enable URLs in path-format
		'urlManager' => array(
			'urlFormat' => 'path',
			'appendParams' => false,
			'rules' => array(
				'<controller:\w+>/<id:\d+>' => '<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
				'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
			),
		),

		// yii-bootstrap扩展
		'bootstrap' => array(
			'class' => 'bootstrap.components.Bootstrap',
		),

		'db' => array(
			'connectionString' => 'mysql:host=localhost;dbname=angel',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			'tablePrefix' => 'angel_',
		),

		'errorHandler' => array(
			'errorAction' => 'site/error',
		),

		'log' => array(
			'class' => 'CLogRouter',
			'routes' => array(
				array(
					'class' => 'CFileLogRoute',
					'levels' => 'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*array(
					'class'=>'CWebLogRoute',
				),*/
			),
		),

		// CMemCache
		'cache' => array(
			'class' => 'CMemCache',
			'servers' => array(
				array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 50),
			),
		),

		// CCacheHttpSession
		'session' => array(
			'class' => 'CCacheHttpSession',
			'cacheID' => 'cache',
			'timeout' => 1800,
		),

		// yii-curl http://www.yiiframework.com/extension/yii-curl/
		'curl' => array(
			'class' => 'ext.Curl',
			'options' => array(),
		),

		// image http://www.yiiframework.com/extension/image
		'image'=>array(
			'class' => 'application.extensions.image.CImageComponent',
			'driver' => 'GD',
		),

	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params' => array(
	// this is used in contact page
	'adminEmail' => 'webmaster@example.com',
	),
);